#ifndef REPORT_DATA_H
#define REPORT_DATA_H

#include <idocumentdata.h>
#include <ieditor.h>
#include <ieditoritem.h>

QT_BEGIN_NAMESPACE
class QStandardItemModel;
QT_END_NAMESPACE

namespace wfnet
{
class BatchJournal;
}

namespace swp
{

class ReportData : public QObject, public core::IDocumentData
{
    Q_OBJECT

public:
    ReportData();
    ~ReportData();

    // IDocumentData
    Type type() const;

    void setConnectionData(const core::ConnectionData &data);
    const core::ConnectionData& connectionData() const;

    bool supportsConnections() const;
    QList<core::ConnectionData> connections(
        const core::IEditorItem* item) const;
    void clearData(const QList<core::IEditorItem* >& preserve =
        QList<core::IEditorItem* >());
    QList<core::ConnectionData> connections() const;

    QString timeStamp() const;
    const QStandardItemModel* executions() const;
    const QStandardItemModel* tokens() const;
    const QStandardItemModel* steps() const;

    void setTimeStamp(const QString& ts);
    void setExecutions(QStandardItemModel* model);
    void setTokens(QStandardItemModel* model);
    void setSteps(QStandardItemModel* model);

signals:
    void dataChanged();

private:
    friend class ReportBuilder;
    friend class SwpReportEditor;
    QString m_timeStamp;
    QStandardItemModel* m_executions;
    QStandardItemModel* m_steps;
    QStandardItemModel* m_tokens;
    core::ConnectionData m_connectionData;
};

} // namespace swp

#endif
